//
//  MessageViewController.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/8/29.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class MessageViewController: KMViewController {

    var messageView : MessageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        self.title = verifyName_title
        
        self.view.backgroundColor = UIColor.verifyColor()
        addSubView()
    }
    
    //MARK: 创建子视图
    fileprivate func addSubView() {
        
        messageView = MessageView.init(frame: .init(x: 0, y: 0, width: ScreenW, height: RATIO_H(maxNum: 270)))
        self.view.addSubview(messageView)
        
        getData()
    }
    
    deinit {
        
        messageView.marqueeView.timer.invalidate()
        messageView.marqueeView.timer = nil
    }
    
    
    //MARK: 获取数据
    fileprivate func getData() {
        
        
        KMTool.requestMethod(.get, URLString: url_verifyNews, parameters: ["psw":"kameng98_loan","user_login":KMTool.stringForEnumKey(.phone) ?? ""], success: { (value, json) in
            
           
            
            if let dic = json.dictionary {
                self.messageView.nameText.text = dic["user_name"]?.stringValue
                self.messageView.numberText.text = dic["identity"]?.stringValue
                
            }
            
        }) {
            
        }
    }
    
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

}
